package top.braycep.ui;

import javax.swing.*;
import java.awt.*;
/*
 * Created by JFormDesigner on Mon Feb 14 23:21:42 CST 2022
 */


/**
 * @author 123
 */
public class AboutUI {
    public static final String VERSION = "0.0.1";
    public static boolean hasNew = false;

    private static void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        dialogMsgBox = new JDialog();
        scrollPane3 = new JScrollPane();
        textPane1 = new JTextPane();

        //======== dialogMsgBox ========
        {
            dialogMsgBox.setTitle("Message Box");
            dialogMsgBox.setResizable(false);
            dialogMsgBox.setMinimumSize(new Dimension(400, 300));
            Container dialogMsgBoxContentPane = dialogMsgBox.getContentPane();
            dialogMsgBoxContentPane.setLayout(new BorderLayout());

            //======== scrollPane3 ========
            {

                //---- textPane1 ----
                textPane1.setContentType("text/html");
                textPane1.setText("<!DOCTYPE html>\n<html lang=\"zh\">\n<head>\n    <meta charset=\"UTF-8\">\n</head>\n" +
                        "<body>\n    <p style=\"font-size: 20px;\">Jar Builder</p>\n    " +
                        "<p>Latest Version: " + VERSION + " </p>\n    <p>Author: Braycep</p>\n    " +
                        "<p>A Easy Way To Build Your Jar File, This Project Is For Learning Only</p>\n    " +
                        "<p>Find Source On <a href=\"#\">Github</a> Or <a href=\"https://gitee.com/braycep/jar-builder-v3\">Gitee</a></p>\n" +
                        "</body>\n</html>");
                textPane1.setEditable(false);
                scrollPane3.setViewportView(textPane1);
            }
            dialogMsgBoxContentPane.add(scrollPane3, BorderLayout.CENTER);
            dialogMsgBox.pack();
            dialogMsgBox.setLocationRelativeTo(dialogMsgBox.getOwner());
        }
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    public static JDialog getDialogMsgBox() {
        // 强制刷新控件状态
        initComponents();

//        dialogMsgBox.addMouseListener(new MouseAdapter() {
//            @Override
//            public void mouseReleased(MouseEvent e) {
//                try {
//                    Desktop.getDesktop().browse(new URL(UpdateUtils.shareUrl).toURI());
//                } catch (Exception ex) {
//                    // ignore
//                }
//            }
//        });

        return dialogMsgBox;
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private static JDialog dialogMsgBox;
    private static JScrollPane scrollPane3;
    private static JTextPane textPane1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
